<html>
<body>
<script>
// JavaScript onbeforeunload dialogs require a user gesture.
if (window.eventSender) {
    eventSender.mouseMoveTo(5, 5);
    eventSender.mouseDown();
    eventSender.mouseUp();
}

window.onbeforeunload = function() {
  window.close();
  return "This should only appear once.";
}
</script>
</body>
</html>
